home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14266 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: aadt.sdt.com!usenet
  2. From: Larry Baker <leb@sdt.com>
  3. Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.win32
  4. Subject: Re: VC++ 4.0 memory allocation slower than in 2.x!!!
  5. Date: Fri, 29 Mar 1996 16:56:35 -0800
  6. Organization: SABRE Decision Technologies
  7. Message-ID: <315C86C3.57BE@sdt.com>
  8. References: <alanDozpsy.Kn6@netcom.com> <4jgde4$kgo_001@chem.uva.nl>
  9. NNTP-Posting-Host: parmail.sdt.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Danny Brands wrote:
  16. > Check the the latest issues of Byte. I think, in the march issue
  17. > they have an article on this. They were running preformance analysis
  18. > programs which did a lot of malloc stuff with unreproducable
  19. > results. I appeared that it had to do with the allignment
  20. > of the allocated block in memory if I understood it well.
  21.  
  22. What was happening was that malloc was returning
  23. byte-aligned allocations.  This is a problem for things like
  24. floats, doubles, ints and longs, as they have a significant
  25. hardware-level performance penalty (on the Pentium, among others)
  26. if they aren't aligned on a 32-bit word boundary.
  27.  
  28. After they used their own (modified) allocation routines (which
  29. really just encapsulated calls to malloc/free, but gauranteed
  30. word-aligned allocations) everything went back to normal.
  31. I believe they posted their allocation routines to BIX or
  32. elsewhere.
  33.  
  34. Note that this has nothing to do with the actual performance of
  35. malloc and free themselves; this has to do with the performance of
  36. the routines that use the memory allocated *by* malloc.
  37.  
  38. Cheers,
  39.  
  40. Larry Baker
  41. leb@sdt.com
  42.